home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TP011093.ARJ / 01-10-93.TPC
Text File  |  1993-01-10  |  49KB  |  1,364 lines

  1.  
  2. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  3.  
  4. Conference 4
  5. Date       01-04-93 00:17:00
  6. From       Dj Murdoch
  7. To         All
  8. Subject    TRASH.ZIP:  a program to detect and fix 
  9.  
  10.  Borland Pascal 7 introduced 32 bit arithmetic for longints, which gives a perform
  11. nce boost over 16 bit arithmetic.  Unfortunately, it's not safe on some PCs:
  12. those running software that trashes the extended registers.
  13.  
  14. The best fix for this would be to replace that buggy software, but that's
  15. not an option in most cases.  An alternative would be to install a TSR that
  16. saved and restored the trashed registers, but to do that, you really need
  17. to the details of which registers get trashed and by what.
  18.  
  19. I've just put together a package called TRASH.ZIP, which does the detection
  20. and general purpose fixes for the register trashing.  I've sent it out on
  21. PDN and to garbo.uwasa.fi on Internet.  It should show up somewhere near you soon.
  22.  
  23.  
  24. BTW, even if you're not particularly worried about the trashed registers,
  25. you might want to take a look.  I used a number of tricks to write a TSR that
  26. hooks 16 different interrupts and counts 9 different kinds of event on each
  27. interrupt, all in BP, and with a memory footprint when resident of 640 bytes.
  28.  (It uses a lot of inline assembler, but no external assembler.  Who needs
  29. one?  :-)
  30.  
  31. --- Msg V3.2
  32.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  33.  * Tossed by SFToss/286 v1.02a on 93/01/05  21:57:51
  34.  
  35. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  36.  
  37. Conference 4
  38. Date       01-04-93 08:27:00
  39. From       Dj Murdoch
  40. To         John Giesbrecht
  41. Subject    Re: TP 7.0
  42.  
  43.   JG> Dj Murdoch (1:249/99.5) wrote to Paul Campisi on <03 Jan 08:34> :
  44.  
  45.  DM> "/F16384" tells BP to ask for a 16384K (i.e. 16 Meg) swap file.  
  46.  
  47.  JG> I'm embarassed to admit that I can't find it, but there's 
  48.  JG> no other way: where, oh where, is this documented?
  49.  
  50. User's Guide, p. 37.  There's no documentation on how to get a swap file for
  51. your own program (though there might be in the Open Architecture book), but
  52. Kim Kokkonen sent me this little unit.  He didn't write it; it came from someone
  53. at Borland.
  54.  
  55.  unit RTMSwap;
  56.  
  57.  interface
  58.  
  59.  const
  60.    rtmOK          = $0;
  61.    rtmNoMemory    = $1;
  62.    rtmFileIOError = $22;
  63.  
  64.  function MemInitSwapFile(FileName: PChar; FileSize: Longint): Integer;
  65.    {  Opens a swapfile of the specified size.  If a swapfile
  66.       already exists, and the new size is larger, the swapfile
  67.       will grow, otherwise the previous swap file parameters are
  68.       used.
  69.  
  70.       Returns:   rtmOK           - Successful
  71.                  rtmNoMemory     - Not enough disk space
  72.                  rtmFileIOError  - Could not open/grow file
  73.    }
  74.  
  75.  
  76.  function MemCloseSwapFile(var Delete: Integer): Integer;
  77.    {  Closes the swapfile if it was created by the current task.
  78.       If the value returned in "Delete" is non-zero, the swapfile
  79.       was deleted.
  80.  
  81.       Returns:   rtmOK           - Successful
  82.                  rtmNoMemory     - Not enough physical memory to run
  83.                                    without the swap file
  84.                  rtmFileIOError  - Could not close/delete the file
  85.    }
  86.  
  87.  implementation
  88.  
  89.    function MemInitSwapFile;  external 'RTM' index 35;
  90.    function MemCloseSwapFile; external 'RTM' index 36;
  91.  
  92.  end.
  93.  
  94.  
  95.  
  96.  
  97. --- Msg V3.2
  98.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  99.  * Tossed by SFToss/286 v1.02a on 93/01/05  21:57:51
  100.  
  101. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  102.  
  103. Conference 4
  104. Date       01-04-93 08:35:00
  105. From       Dj Murdoch
  106. To         Aaron Marasco
  107. Subject    Re: LONGINT SUBTRACTION
  108.  
  109.   AM>  On 12-28-92 DJ MURDOCH wrote to AARON MARASCO...  
  110.  DM>         TIMENOW := longint(HoursZ)*3600 + longint(MinutesZ)*60 +  
  111.  DM> SecondsZ;  
  112.  AM> Thanks. I didn't realize that longint is a function. It's not  
  113.  AM> listed in TP6 Run-Time Library book. However, it does work!  
  114.  AM> Thanks a real lot!  
  115.  
  116. It's not really a function, but TP allows you to use it as one.  Here I'm
  117. using it for an explicit type conversion.  
  118.  
  119. --- Msg V3.2
  120.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  121.  * Tossed by SFToss/286 v1.02a on 93/01/05  21:57:51
  122.  
  123. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  124.  
  125. Conference 4
  126. Date       01-04-93 08:38:00
  127. From       Dj Murdoch
  128. To         Goran Eriksson
  129. Subject    Re: DPMI and int vectors
  130.  
  131.   GE> Is there any documentation out there on how I could 
  132.  GE> execute privileged instructions from my Borland Pascal 
  133.  GE> protected mode application?
  134.  
  135. I think generic DPMI documentation is all I've seen.  You're not allowed to
  136. execute the privileged instructions yourself, but the DPMI server will provide
  137. all the safe services for you.  I forget where the official DPMI docs come
  138. from , but you can look in a generic manual like Ralf Brown's PC Interrupts
  139. book (or his interrupt list), or Ray Duncan's Extending DOS.
  140.  
  141.  GE> But that seems to get me something in x that isn't the 
  142.  GE> correct physical IDTR base address. The interrupt table 
  143.  GE> limit in x[1] seems ok though (2047). What is the correct 
  144.  GE> syntax for getting that information?
  145.  
  146.  GE> By the way. According to my sources the IDTR base address 
  147.  GE> is 24 bits in the 80286. I don't have the the Intel 80386 
  148.  GE> Programmer's Reference Manual at home so I cannot check, 
  149.  GE> but I could well believe that that address has been 
  150.  GE> extended to 32 bits in the '386. Considering that the DPMI 
  151.  GE> environment seems to be built on the '286 architecture, 
  152.  GE> would it be correct by me to assume that in a BP protected 
  153.  GE> mode application only 24 bits should be used? Even when 
  154.  GE> running on a '386 or '486?
  155.  
  156.  Sorry, I've never played around with those things.  I don't know.
  157.  
  158. --- Msg V3.2
  159.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  160.  * Tossed by SFToss/286 v1.02a on 93/01/05  21:57:52
  161.  
  162. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  163.  
  164. Conference 4
  165. Date       01-04-93 08:43:00
  166. From       Dj Murdoch
  167. To         Goran Eriksson
  168. Subject    Re: DPMI base addresses
  169.  
  170.   GE> Doing some experiments of my own I find that it could well 
  171.  GE> be that the segment descriptor bit is included in the 
  172.  GE> GetSelectorBase function result. Also I find that 
  173.  GE> inconsistent with the GetSelectorBase description in the Language Guide.
  174.  
  175.  GE> Is there any more detailed (and maybe accurate) 
  176.  GE> documentation elsewhere? In the Borland Open Architecture 
  177.  GE> Handbook or in the Windows API Reference?
  178.  
  179. I don't have either of those so I couldn't tell you.  BTW, where did you find
  180. GetSelectorBase described?  All I can see is one line; did you find more than that?
  181.  
  182.  
  183. --- Msg V3.2
  184.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  185.  * Tossed by SFToss/286 v1.02a on 93/01/05  21:57:52
  186.  
  187. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  188.  
  189. Conference 4
  190. Date       01-04-93 08:47:00
  191. From       Dj Murdoch
  192. To         JEFF GUILLAUME
  193. Subject    Re: Heap overflow!! Argh!
  194.  
  195.   JG> help with that? <grin>).  Can anyone explain to me what's wrong
  196.  JG> with this?  First of all, let me define my memory settings, types,
  197.  JG> etc....
  198.  
  199.  JG> {$M 60000,0,655350}
  200.  
  201.  JG> Type
  202.  JG>   CallsToday = Record
  203.  JG>                  CallerNum   : LongInt;    {* Caller number of caller *}
  204.  
  205.  JG>                  Name        : String;     {* Name of caller *}
  206.  JG>                  UserNum     : String;     {* User number of caller *}
  207.  JG>                  TimeCalled  : String;     {* Time they called *}
  208.  JG>                  DateCalled  : String;     {* Date they called *}
  209.  JG>                  Baud        : String;     {* Baud rate *}
  210.  JG>                End;
  211.  
  212. That record takes up 1284 bytes (or so).  You could make it a lot more efficient
  213. by using shorter strings, or by using PString pointers in the record.
  214.  
  215. --- Msg V3.2
  216.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  217.  * Tossed by SFToss/286 v1.02a on 93/01/05  21:57:52
  218.  
  219. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  220.  
  221. Conference 4
  222. Date       01-05-93 07:52:00
  223. From       Dj Murdoch
  224. To         Joe Jared
  225. Subject    Re: Bug testers wanted
  226.  
  227.   JJ> Keypressed is broken in TP 6.0, so if it's broken in 7.0 
  228.  JJ> I'm not surprised.
  229.  JJ> I initially used keypressed in my sprite engine keyboard 
  230.  JJ> handler, but it got confused when the keyboard buffer 
  231.  JJ> loaded up, and looped itself to death.
  232.  
  233. I've never heard of this before - could you tell me how to reproduce it?
  234.  
  235. --- Msg V3.2
  236.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  237.  * Tossed by SFToss/286 v1.02a on 93/01/07  08:51:06
  238.  
  239. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  240.  
  241. Conference 4
  242. Date       01-05-93 07:56:00
  243. From       Dj Murdoch
  244. To         Ron Allred
  245. Subject    Re: TEMC.EXE
  246.  
  247.   RA>     Does anybody know what this file does?  I just noticed 
  248.  RA> it in my turbo directory.  
  249.  
  250. It's the macro compiler; I don't think it's described in the manual in TP
  251. 6 or BP 7, but is documented in TEMC.DOC.
  252.  
  253. --- Msg V3.2
  254.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  255.  * Tossed by SFToss/286 v1.02a on 93/01/07  08:51:06
  256.  
  257. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  258.  
  259. Conference 4
  260. Date       01-05-93 08:02:00
  261. From       Dj Murdoch
  262. To         Howard Hamlin
  263. Subject    Re: Protected Mode IDE pr
  264.  
  265.   HH> This is NOT a hardware problem for several reasons : Too many of us are
  266.  HH> experiencing this problem only when using Borland's DPMI interface.  I've
  267.  
  268.  HH> never had this problem with my PC before.  I have a plain-vanilla 286 (DOS
  269.  
  270.  HH> 3.2, no TSR's, no QEMM/386 MAX) and I'm having the 
  271.  HH> problem.  So, all things
  272.  HH> considered, I have to blame the DPMI.
  273.  
  274. Borland's DPMI server may be the only protected mode program you've run, or
  275. may be unique in some other way.  Just because it's the only program you've
  276. found that has trouble on your machine isn't strong evidence that there's
  277. anything wrong with it.
  278.  
  279. Borland *does* have a history of writing programs that test the system more
  280. than others; witness all the problems people had with buggy mouse drivers
  281. under TP 6.  This has both positive and negative aspects:  it means they can
  282. get more performance out of very stable systems, but are likely to push flaky
  283. ones over the edge.
  284.  
  285.  
  286. --- Msg V3.2
  287.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  288.  * Tossed by SFToss/286 v1.02a on 93/01/07  08:51:06
  289.  
  290. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  291.  
  292. Conference 4
  293. Date       01-05-93 20:18:00
  294. From       Terry Hughes
  295. To         John Reid
  296. Subject    Data-Base ToolBox 4.0 bu
  297.  
  298.  
  299. JR> BTW, the separate sort routine is still very useful. It is a nonrecursive
  300. JR> quicksort that (unlike Turbo Power's similar unit) automatically goes to
  301.  
  302. JR> disk when it runs out of heap. It is fast and real easy to use to sort
  303. JR> anything.
  304.  
  305. You seem to be implying that our MSORT doesn't automatically go to disk
  306. when it runs out of heap space. That's not true.
  307.  
  308. If all items fit in memory then MSORT does an in-memory non-recursive
  309. quicksort. If all items don't fit in memory then it will start writing
  310. out merge buffers to either disk or EMS. And MSORT works in real mode,
  311. protected mode and Windows; plus it can be up to several times faster
  312. than Turbo Access's sort (depending on the sort parameters).
  313.  
  314. Oh wait ... maybe you were referring to the sort routines provided by
  315. TPRO and OPRO? In that case you are correct; they were designed for
  316. simple in-memory sorts only. I wouldn't try to compare those sort units
  317. with the one's in Turbo Access; each was designed with a different
  318. objective in mind.
  319.  
  320. -Terry
  321. ___
  322.  X QMPro 1.0 41-2187 X TurboPower Software (voice 719-260-6641)
  323.  
  324. --- Maximus 2.01wb
  325.  * Origin: The Programmers Playhouse (1:128/60)
  326.  * Tossed by SFToss/286 v1.02a on 93/01/07  08:51:26
  327.  
  328. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  329.  
  330. Conference 4
  331. Date       01-05-93 21:05:00
  332. From       Dj Murdoch
  333. To         Tim Evans
  334. Subject    Streams (was Typed Files.)
  335.  
  336.   TE> Could you give us a short tutorial on how to use streams? 
  337.  TE> I've been playing around with them, but am having a hard 
  338.  TE> time understanding it. What are the advantages to using them?
  339.  
  340. Sure, I'll give a quick tutorial.   I'll assume you want to use them as a
  341. substitute for typed files or for untyped files using BlockRead/BlockWrite.
  342.  That's what the manual misses.  It gives quite a good discussion of how to
  343. use objects with them, so I won't talk about that.
  344.  
  345. So here goes:
  346.  
  347. Let's say you have a big database that's made up of all the same kind of record, say
  348.  
  349.  
  350.   type
  351.     Tdatarec = record
  352.       name : string[40];
  353.       address1 : string[80];
  354.       address2 : string[80];
  355.       address3 : string[80];
  356.     end;
  357.  
  358. Then a fairly natural standard Pascal way to store this is in a "file of Tdatare
  359. ".  This would be a binary file; it would contain multiple copies of these
  360. records, at 41 + 3*81 = 284 bytes each.
  361.  
  362. However, this is a pretty inefficient way to store a record like this if all
  363. you want is sequential access.  The reason is that most names won't use a
  364. full 40 characters, and most addresses won't be a full 3 lines of 80 characters.
  365.  You're probably storing a lot of junk at the end of each string that's not
  366. needed (and can even be a security problem:  someone could look at the junk
  367. in a binary file viewer, and see whatever was sitting in that spot in memory
  368. before you loaded your program).
  369.  
  370. A more efficient way to store this record is just to store as much of each
  371. string as you actually use.  If length(name) = 10, then store 1 byte containing
  372. the length, and 10 bytes of name, for a saving of 29 characters.  Same for
  373. the address lines.
  374.  
  375. The trouble is that standard Pascal provides no support for this kind of thing.
  376.  Typed files have to consist of elements that are all of a fixed size; variable
  377. sized records aren't allowed.  Before they introduced objects, Borland worked
  378. around this by introducing the untyped file.  It's essentially just a stream
  379. of bytes (or some other fixed record size), which you can read by specifying
  380. the number of bytes you want to read each time.  
  381.  
  382. To read one of the records above, you'd do something like this:
  383.  
  384.   procedure ReadRec(var f:file; var DataRec: TDataRec);
  385.   begin
  386.     with DataRec do
  387.     begin
  388.       blockread(f,DataRec.name[0],1);
  389.       blockread(f,DataRec.name[1], length(name));
  390.       { etc. for address1, address2, address3 }
  391.     end;
  392.   end;
  393.  
  394. var
  395.   f : file;
  396.   datarec : TDatarec; begin
  397.   assign(f,'filename.dat');
  398.   reset(f,1);
  399.   ReadRec(f, Datarec);
  400.   { etc. }
  401.   Close(f);
  402.  
  403.  This is treating your data file as a stream of bytes, and doing slightly
  404. lower level I/O than a typed file does.  If you're happy with this, then you
  405. already know how to use Streams.
  406.  
  407. There are a few problems with the Blockread approach.  First, one of the most
  408. common errors in using untyped files is to Reset them improperly:  you need
  409. to say
  410.    Reset(f,1);
  411. *not*
  412.    Reset(f); 
  413. or you end up with a record size of 128 bytes, and wipe out all kinds of things
  414. in memory when the attempt to read the name doesn't just read length(name)
  415. bytes, but reads 128*length(name) bytes.
  416.  
  417. The second big problem with BlockRead is also associated with the Reset. 
  418. Reset doesn't let you specify whether you want read-only or read-write access. 
  419.  
  420.  You need to fiddle with the System unit's FileMode variable to control that.
  421.  This is probably the most common error in using BlockRead; programs that
  422. only need to read a file will open it in the default read-write mode, and
  423. bomb when the file has been declared read-only.  (Just noticed that I forgot
  424. it in my sample:  I should have put FileMode := 0 before the Reset.)
  425.  
  426. The final problem with BlockRead is speed.  If you fill out my ReadRec procedure
  427. to read all 4 fields, you'll find that it's calling DOS 8 separate times to
  428. read data from the disk.  DOS does some buffering, and a disk cache helps,
  429. but this is still much slower than doing it all in a single read.  This means
  430. that people using BlockRead usually read a big block into a buffer, and then
  431. dissect the buffer themselves.
  432.  
  433. All of this is much simpler if you use Streams.   The program fragment above
  434. would look like this:
  435.  
  436.   procedure ReadRec(S:PStream;var DataRec:TDataRec);
  437.   begin
  438.     with DataRec do
  439.     begin
  440.       S^.Read(name[0],1);
  441.       S^.Read(name[1],length(name));
  442.       { etc. for address1, address2, address3 }
  443.     end;
  444.   end;
  445.  
  446. var
  447.   S : PStream;
  448.   datarec : TDatarec; begin
  449.   S := New(PBufStream, init('filename.dat',stOpenRead,2048));
  450.   { This opens the stream in read-only mode with a 2048 byte buffer. }
  451.   ReadRec(S, Datarec);
  452.   { etc. } 
  453.   Dispose(S,done);
  454.  
  455. The real advantage comes when you want to make a change.  If it turns out
  456. that the buffer isn't necessary, you just change one line:
  457.  
  458.   S := New(PDOSStream, init('filename.dat',stOpenRead));
  459.   This opens the file without buffering, and is almost identical to using
  460. BlockRead.  Or if you find that a buffered file isn't fast enough, you can
  461. easily copy the whole file into memory (using a TMemoryStream in TP 7, or
  462. a TEMSStream in TP 6, or lots of different specialized streams that you could
  463. write yourself).  The way you set up your file will be different, but the
  464. way to read from it will be identical.
  465.  
  466. There are some negatives with streams, but this message is long enough that
  467. I won't discuss them.  Just a quick list:
  468.  
  469. In the original release of TP 6.00, the TBufStream had a bug that showed up
  470. if you mixed Seek and Write; if you swap the parameters stOpenRead and 2048
  471. in your TBufStream.Init call, you can cause really bizarre behaviour; if you
  472. specify the wrong size for a read, you can get very confused.
  473.  
  474.  
  475. --- Msg V3.2
  476.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  477.  * Tossed by SFToss/286 v1.02a on 93/01/07  20:52:16
  478.  
  479. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  480.  
  481. Conference 4
  482. Date       01-06-93 08:03:00
  483. From       Dj Murdoch
  484. To         Aaron Marasco
  485. Subject    Re: LONGINT SUBTRACTION
  486.  
  487.   AM> It still doesn't work though. The LongInt function works, but I  
  488.  AM> still cannot subtract the two longints?!?!  
  489.  AM>   
  490.  AM> FUNCTION ELAPSEDTIME(VAR timername: TIMERTYPE): LONGINT;  
  491.  AM> VAR  
  492.  AM>    TDiffZ : LONGINT;  
  493.  AM> BEGIN  
  494.  AM>    TDiffZ := ( Timername[2] - Timername[1] ) ; {what is 
  495.  AM> the problem here?}  
  496.  
  497. There's probably something wrong with your declaration of TIMERTYPE.
  498.  
  499.  
  500. --- Msg V3.2
  501.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  502.  * Tossed by SFToss/286 v1.02a on 93/01/07  20:52:16
  503.  
  504. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  505.  
  506. Conference 4
  507. Date       01-06-93 20:58:00
  508. From       Dj Murdoch
  509. To         Jud Mccranie
  510. Subject    Re: BP 7 bug list
  511.  
  512.   DM> Tab is for navigation, not selection.  For more detail, see one
  513.  DM> of my earlier messages explaining this to you.
  514.  
  515.  JM> I know that, but you're still missing the point.  Tab navigates,
  516.  JM> cursor keys highlight, and RETURN selects the highlighted item,
  517.  JM> EXCEPT if you are selecting the primary file and have not pressed
  518.  JM> any cursor control keys.
  519.  
  520. No.  RETURN only selects the highlighted item when it happens to agree with
  521. the input line.  RETURN selects the input line.
  522.  
  523.  JM> Compare the way New works to selecting Primary.  New works correctly.
  524.  
  525. I don't know what you're talking about.  File New doesn't give you a file
  526. dialog.
  527.  
  528. Let's just give up on this one, okay?  I'm not particularly interested in
  529. bugs that have no effect on the output of the compiler.  If you don't like
  530. the way it works, complain to Borland. 
  531.  
  532. --- Msg V3.2
  533.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  534.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:11:57
  535.  
  536. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  537.  
  538. Conference 4
  539. Date       01-06-93 21:04:00
  540. From       Dj Murdoch
  541. To         Jud Mccranie
  542. Subject    Re: bug testers wanted
  543.  
  544.   JM> I tried the test on my system, since I'm prone to wierd lockups,
  545.  JM> etc, but it ran OK.  I'll try it on a 486 running Lantastic and
  546.  JM> see what happens.
  547.  
  548. Thanks.  If you want to try out the full detector, I sent it out as TRASH.ZIP
  549. on PDN a few days ago.  I never did hear from anyone who had the bug on their
  550. own, so I had to make a buggy TSR to try it on.  I hope it works in the real
  551. case, too.
  552.  
  553. --- Msg V3.2
  554.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  555.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:11:57
  556.  
  557. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  558.  
  559. Conference 4
  560. Date       01-04-93 12:56:00
  561. From       Mark Ouellet
  562. To         Canadian Bp 7.0 Users!!!!!!!!!
  563. Subject    VERY IMPORTANT, PLEASE READ THIS!!!!!
  564.  
  565.  
  566. Hi Canadians,
  567.  
  568.     If you are planning on buying OPEN ARCHITECTURE for BP 7.0. It is
  569. not yet available from Borland Canada!!!!
  570.  
  571. I ordered it and got the C++ version!!!
  572.  
  573. The Pascal version is available from Borland USA.
  574.  
  575.     If you call Borland Canada to order this, make sure you ask them to
  576. confirm it is the PASCAL version and tell them you know a pascal version
  577. is available from Borland USA (They have no clue as to wether or not a
  578. Pascal version is comming to Canada, so they might think the C++ version
  579. is the only one). Since I now told them there was a Pascal version
  580. available from Borland USA, they might move a bit faster to get it
  581. available here.
  582.  
  583. So they might have it when *YOU* call to order, just make sure of it.
  584.  
  585.     If like me you got the wrong version from Borland Canada, you can
  586. call them to get a return number and send them the product, COLLECT!!!
  587.  
  588.     Borland USA will also accept Canadian orders of Open Architecture
  589. for Pascal. That's where I ordered my new copy.
  590.  
  591.         Best regards,
  592.         Mark Ouellet.
  593.  
  594.  
  595. --- Squish v1.01
  596.  * Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
  597.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  598.  
  599. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  600.  
  601. Conference 4
  602. Date       01-06-93 01:50:00
  603. From       Mark Ouellet
  604. To         Mike Copeland
  605. Subject    Re: backspace
  606.  
  607.  
  608.     On 02-Jan-93, you, Mike Copeland, of 1:114/18.10 wrote...
  609.  
  610.  MC> Not really.  In other messages I've posted, I show _all_ of what I
  611.  MC> do, which is:
  612.  MC> 
  613.  MC> if Length(S) > 0 then Dec(S[0]);
  614.  MC> 
  615.  MC> The particular message I was replying to had a very convoluted way of
  616.  MC> decrementing the length (regardless of the string length), and I was
  617.  MC> merely showing a simpler way of doing it. I learned long ago to assure
  618.  MC> the valid length of the string before reducing it...  8<}}
  619.  
  620. Well Mike,
  621.     In that case it probably would have been better to show the full
  622. code. One more line doesn't make much of a difference for echomail but
  623. it can make a world of difference to new users who missed your first
  624. post and are unaware you first checked the length.
  625.  
  626.         Best regards,
  627.         Mark Ouellet.
  628.  
  629.  
  630. --- Squish v1.01
  631.  * Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
  632.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  633.  
  634. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  635.  
  636. Conference 4
  637. Date       01-06-93 01:52:00
  638. From       Mark Ouellet
  639. To         Andres Cvitkovich
  640. Subject    Re: Checking file types
  641.  
  642.  
  643.     On 28-Nov-92, you, Andres Cvitkovich, of 2:310/36.9 wrote...
  644.  
  645.  AC> PrintableFile := TRUE; if ext[0] = #3 then
  646.  >>  TC>        PrintableFile := (pos(ext,'.OBJ.COM.EXE') = 0);
  647.  
  648.  AC> Maybe TeeCee would write it this way if he thinks it over. Should work
  649.  AC> perfectly, then (though untested) :-)
  650.  
  651. Andres,
  652.     implest fix I have seen so far, congratulations!!!
  653.  
  654.         Best regards,
  655.         Mark Ouellet.
  656.  
  657.  
  658. --- Squish v1.01
  659.  * Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
  660.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  661.  
  662. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  663.  
  664. Conference 4
  665. Date       01-06-93 01:56:00
  666. From       Mark Ouellet
  667. To         Andres Cvitkovich
  668. Subject    Re: Speed wanted !
  669.  
  670.  
  671.     On 28-Nov-92, you, Andres Cvitkovich, of 2:310/36.9 wrote...
  672.  
  673.  AC> Hi Mark (again),
  674.  
  675.     Well hi Again Andres
  676.  
  677.  >>     Actually, 64K or 65536 bytes or array [0..65535]
  678.  >> of byte IS the largest allowed.
  679.  AC> if you'd have tried, you'd see that array[1..65535] is the largest
  680.  AC> possible array (tested!) though not recommendable.
  681.  
  682.     I Stand corrected, I just tried it and you are right. Wether it is
  683. declared as a type or directly in a cariable definition 65535 bytes is
  684. the maximum. Thanks for pointing that out!!
  685.  
  686.  >>     65520 is the largest data structure SAFE to use. The reason is that
  687.  >> offsets will vary from 0 to F in normalized pointers.
  688.  
  689.  AC> in TP6, offsets will be 0 or 8 only since Heap is allocated in 8-byte
  690.  AC> blocks (that's a tribute to the object-oriented programming,
  691.  AC> especially Turbo Vision), and if the byte array is the only var, you
  692.  AC> can be rather sure it's offset is 0.
  693.  
  694. Yes Andres,
  695.     I had seen reference to the effect that 65528 was safe to use.
  696. Apparently someone came to that conclusion through some testing. I
  697. decided to stay on the safe side though as I beleive 65520 is safe to
  698. use from TP 4.0 to TP 7.0.
  699.  
  700.         Best regards,
  701.         Mark Ouellet.
  702.  
  703.  
  704. --- Squish v1.01
  705.  * Origin: The Sequel to Cramer VS Cramer: TPCramer VS UUencode ;-) (1:240/20.4)
  706.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  707.  
  708. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  709.  
  710. Conference 4
  711. Date       01-06-93 14:16:00
  712. From       Mark Ouellet
  713. To         Francois Thunus
  714. Subject    Re: TCSEL003: ReadTxt
  715.  
  716.  
  717.     On 31-Dec-92, you, Francois Thunus, of 2:270/25.1 wrote...
  718.  
  719.  FT> Nothing fancy, as you can see. However, when i try to read a text
  720.  FT> with more than 254 lines, it freezes even thought i still have more
  721.  FT> than 500k available (using the line command compiler-nothing else but
  722.  FT> my program in memory. the program part is 57 k and the data part 42k,
  723.  FT> reported by tpc after compiling). The compiler directive for memory
  724.  FT> are heap 5076, min stack 65530 max stack 655300. I have tried various
  725.  FT> min stack and heap size from 0 to the maximum possible.
  726.  
  727. Francois,
  728. You could use the following unit provided to Pascal echo readers by
  729. Wilbert Van.Leijen:
  730.  
  731. Unit TextUtil;
  732. {    Written by Wilbert Van.Leijen and posted in the Pascal Echo }
  733.  
  734. Interface
  735.  
  736. Function TextFilePos(Var f : Text) : LongInt;
  737. Function TextFileSize(Var f : Text) : LongInt;
  738. Procedure TextSeek(Var f : Text; n : LongInt);
  739.  
  740. Implementation
  741. uses Dos;
  742.  
  743. {$R-,S- }
  744.  
  745. Procedure GetFileMode; Assembler;
  746.  
  747. ASM
  748.                 CLC
  749.                 CMP    ES:[DI].TextRec.Mode, fmInput
  750.                 JE     @1
  751.                 MOV    [InOutRes], 104         { 'File not opened for reading' }
  752.                 XOR    AX, AX                  { Zero out function result }
  753.                 XOR    DX, DX
  754.                 STC
  755. @1:
  756. end;  { GetFileMode }
  757.  
  758. Function TextFilePos(Var f : Text) : LongInt; Assembler;
  759.  
  760. ASM
  761.         LES    DI, f
  762.         CALL   GetFileMode
  763.         JC     @1
  764.  
  765.         XOR    CX, CX                  { Get position of file pointer }
  766.         XOR    DX, DX
  767.         MOV    BX, ES:[DI].TextRec.handle
  768.         MOV    AX, 4201h
  769.         INT    21h                     { offset := offset-BufEnd+BufPos }
  770.                 XOR    BX, BX
  771.         SUB    AX, ES:[DI].TextRec.BufEnd
  772.         SBB    DX, BX
  773.         ADD    AX, ES:[DI].TextRec.BufPos
  774.         ADC    DX, BX
  775. @1:
  776. end;  { TextFilePos }
  777.  
  778.  
  779. Function TextFileSize(Var f : Text) : LongInt; Assembler;
  780.  
  781. ASM
  782.                 LES    DI, f
  783.                 CALL   GetFileMode
  784.                 JC     @1
  785.  
  786.                 XOR    CX, CX                  { Get position of file pointer }
  787.         XOR    DX, DX
  788.         MOV    BX, ES:[DI].TextRec.handle
  789.         MOV    AX, 4201h
  790.                 INT    21h
  791.         PUSH   DX                      { Save current offset on the stack }
  792.  
  793.                 PUSH   AX
  794.         XOR    DX, DX                  { Move file pointer to EOF }
  795.         MOV    AX, 4202h
  796.         INT    21h
  797.         POP    SI
  798.         POP    CX
  799.                 PUSH   DX                      { Save EOF position }
  800.         PUSH   AX
  801.         MOV    DX, SI                  { Restore old offset }
  802.         MOV    AX, 4200h
  803.         INT    21h
  804.         POP    AX                      { Return result}
  805.         POP    DX
  806. @1:
  807. end;  { TextFileSize }
  808.  
  809. Procedure TextSeek(Var f : Text; n : LongInt); Assembler;
  810.  
  811. ASM
  812.         LES    DI, f
  813.                 CALL   GetFileMode
  814.         JC     @2
  815.  
  816.         MOV    CX, Word Ptr n+2        { Move file pointer }
  817.         MOV    DX, Word Ptr n
  818.         MOV    BX, ES:[DI].TextRec.Handle
  819.                 MOV    AX, 4200h
  820.                 INT    21h
  821.                 JNC    @1                      { Carry flag = reading past EOF }
  822.                 MOV    [InOutRes], AX
  823.                 JMP    @2
  824.                                                                              { Force read next time }
  825. @1:     MOV    AX, ES:[DI].TextRec.BufEnd
  826.                 MOV    ES:[DI].TextRec.BufPos, AX
  827. @2:
  828. end;  { TextSeek }
  829. end.  { TextUtil }
  830.  
  831.     With the aid of that unit you could save the position of each line
  832. in the text file to an array of Longint as you read them. You can also
  833. open a temporary file, a file of longint, where each record would simply
  834. represent the offset of that line in the text file. If you need to go
  835. back in the text, simply read the offset of the line where you which to
  836. restart reading. Suppose you are on line 391 and you decide to go back
  837. say, 100 lines, simply do a Seek(MyIndex, CurrentLine-100). Then use the
  838. TextSeek procedure to seek to that position in the text file and start
  839. reading again, taking into acount that you allready read those lines so
  840. you either re-write the offsets to your index file, which won't hurt
  841. since you will just be overwriting the records with the same values
  842. again or simply skip writing the offsets until you reach a point where
  843. NEW lines that haven't yet been read are reached. Save any new offset as
  844. you read forward.
  845.  
  846.     With this method you can go back-wards as well as forwards. In fact
  847. if you first read the file, saving all offsets until the end, you can
  848. offer the user to seek to any line number.
  849.  
  850.     When you read new lines or seek backwards, simply flush any lines
  851. from memory. Or maybe you could decide to keep a predetermined number of
  852. lines in memory say 300. When ever the user asks to read forward or
  853. backwards, simply flush the 100 first or Last line, depending on the
  854. direction the user wants to go, and read 100 new lines from the text
  855. file.
  856.  
  857.     Maybe the best approach to be sure of sufficient memory is to
  858. determine how many lines will fit. Suppose you limit line lengths to 255
  859. caracters. Determine how many will fit in a worse case scenario. Create
  860. as many 255 caracter strings as will fit. Divide that number of lines by
  861. 4. Say you managed to create 1000 strings of 255 caracters. Divided by 4
  862. is 250. So set a limit to 750 strings to be safe and make any disk
  863. accesses in bundles of 250 Lines.
  864.  
  865.     You can also keep the line offsets in memory in arrays but you will
  866. be limited to 65520 / 8 = 16380 lines. Make that two arrays stored on
  867. the heap and you've got yourself enough space to store 32760 line
  868. offsets which at 255 caracters by line would be an 8.3 Meg file.
  869.  
  870. Hope this helps.
  871.  
  872.         Best regards,
  873.         Mark Ouellet.
  874.  
  875.  
  876. --- Squish v1.01
  877.  * Origin: Sequel to Cramer VS Cramer: TPCramer VS UUencode;-) (1:240/20.4)
  878.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  879.  
  880. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  881.  
  882. Conference 4
  883. Date       01-06-93 14:51:00
  884. From       Mark Ouellet
  885. To         Preston Garrison
  886. Subject    Re: Hmm
  887.  
  888.  
  889.     On 31-Dec-92, you, Preston Garrison, of 1:150/320.0 wrote...
  890.  
  891.  PG> Could someone please explane to me why XX or other type of encoded
  892.  PG> messages aren't allowed?? What is the differents between sending
  893.  PG> someone  your source to you program or someone sending and XX version
  894.  PG> of this  source in LZH format, besides the obvious THE XX VERSION IS
  895.  PG> MORE THEN  HALF THE SIZE!!!!!!!!
  896.  
  897. Preston,
  898.     The main reason is that since XX can work on binary files such as
  899. ZIPs ARjs etc... there is no way to garrantee that ONLY Source will be
  900. sent this way. .TPU's are of no help to users who read this echo to
  901. learn. Source is usefull though. Also an XX encoded message, even if it
  902. contains source is not directly readable. I intend to include decoders
  903. to most common encoders used in fidonet when I finally start programming
  904. my offline reader but that won't be for some time. So those messages are
  905. not readable as they are and one can't know if they need it until they
  906. extract them.
  907.  
  908.     The main reason for this echo though has allways been to provide
  909. knowledge and help and as such Source code is the only allowable form.
  910. because of that, TeeCee once wrote TPCrammer, which was a tokenizer that
  911. compressed Pascal Source files enough to be posted by replacing ONLY
  912. Tokens and Reserved keywords such as BEGIN, END etc.. with a Token
  913. number. It was soon droped because the readability was still missing.
  914.  
  915.         Best regards,
  916.         Mark Ouellet.
  917.  
  918.  
  919. --- Squish v1.01
  920.  * Origin: Sequel to Cramer VS Cramer: TPCramer VS UUencode;-) (1:240/20.4)
  921.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  922.  
  923. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  924.  
  925. Conference 4
  926. Date       01-06-93 15:08:00
  927. From       Mark Ouellet
  928. To         Dj Murdoch
  929. Subject    Re: Windows API Call
  930.  
  931.  
  932.     On 01-Jan-93, you, Dj Murdoch, of 1:249/99.5 wrote...
  933.  
  934.  MO>>>     Pascal can't be told to use C convention.
  935.  
  936.  DM>> Why couldn't Pascal use the C convention?
  937.  
  938.  MO>>     Have you seen a keyword to tell TP to use C parameter-passing
  939.  MO>> convention??? I know I haven't but if you got a scoop then go ahead!
  940.  
  941.  DM> Sorry, I thought you were talking in general.  No, TP is completely
  942.  DM> inflexible.  Other Pascals aren't; e.g. SBP+ is supposed to be quite
  943.  DM> flexible about calling convention.
  944.  
  945. Dj,
  946.     The error is partly mine, I should have said "Turbo Pascal"!!! So
  947. I'll take half of your apology if you'll take half of mine ;-)
  948.  
  949.         Best regards,
  950.         Mark Ouellet.
  951.  
  952.  
  953. --- Squish v1.01
  954.  * Origin: Sequel to Cramer VS Cramer: TPCramer VS UUencode;-) (1:240/20.4)
  955.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  956.  
  957. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  958.  
  959. Conference 4
  960. Date       01-06-93 15:17:00
  961. From       Mark Ouellet
  962. To         Håkan Johansson /Under Utblidn
  963. Subject    Re: DPMI
  964.  
  965.  
  966.     On 31-Dec-92, you, Håkan Johansson /Under Utblidning, of 2:201/602.
  967. 0 wrote..
  968.  
  969.  DM>> I don't think they need to be in fixed segments.  They use the same 
  970.  
  971.  DM>> call mechanism as virtual methods for objects, and those certainly 
  972.  DM>> don't need to be in fixed segments.
  973.  
  974.  HJ> Rereading chapter 17 in the Language guide I "saw" the following two
  975.  HJ> sentences on page 195-196: "For example, by simply updating the base
  976.  HJ> address field of a segment's descriptor, the operating system can move
  977.  HJ> a segment around in physical memory without affecting the application
  978.  HJ> that uses the segment. The application refers to the segment's
  979.  HJ> selector only, and the selector isn't affected by changes to the
  980.  HJ> descriptor." I guess it answer the question. But why then do interrupt
  981.  HJ> handlers need to reside in fixed segments? After all, the interrupt
  982.  HJ> enable flag is cleared during a memory move, isn't it? Then again,
  983.  HJ> perhaps the addresses of the interrupt handlers aren't stored in low
  984.  HJ> memory as in real mode. But must they not be? I guess I'm rather
  985.  HJ> confused about this! :-) /Haakan J.
  986.  
  987. Håkan,
  988.     because if they are not stored in FIXED segment then the operating
  989. system could move the code around. Which means, the interrupt adress
  990. would point to a zone of memory where your interrupt routine USED TO
  991. BE!! OUCH!!! You can easily imagine what would happen on the next
  992. interrupt.
  993.  
  994.         Best regards,
  995.         Mark Ouellet.
  996.  
  997.  
  998. --- Squish v1.01
  999.  * Origin: Sequel to Cramer VS Cramer: TPCramer VS UUencode;-) (1:240/20.4)
  1000.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  1001.  
  1002. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1003.  
  1004. Conference 4
  1005. Date       01-06-93 15:49:00
  1006. From       Mark Ouellet
  1007. To         Boxo D Clown
  1008. Subject    Re: Troi
  1009.  
  1010.  
  1011.     On 12-Nov-92, you, Boxo D Clown, of 51:808/50.0 wrote...
  1012.  
  1013.  BD> Ugh.  Are these appropriate in here.
  1014.  
  1015.     NO!!! They Aren't, nor are the other dozen or so that have been sent
  1016. allready!!
  1017.  
  1018.     This is the Pascal echo, Trevor Carlsen was/is the moderator until
  1019. ?? can't remember what date.. At which time Duncan J Murdoch will be
  1020. taking over Trevor's responsability to the end of the normal term. At
  1021. which time I guess we'll have another election.
  1022.  
  1023.         Best regards,
  1024.         Mark Ouellet.
  1025.  
  1026.  
  1027. --- Squish v1.01
  1028.  * Origin: Sequel to Cramer VS Cramer: TPCramer VS UUencode;-) (1:240/20.4)
  1029.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  1030.  
  1031. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1032.  
  1033. Conference 4
  1034. Date       01-06-93 15:56:00
  1035. From       Mark Ouellet
  1036. To         Dj Murdoch
  1037. Subject    Re: Turbo Vision
  1038.  
  1039.  
  1040.     On 01-Jan-93, you, Dj Murdoch, of 1:249/99.5 wrote...
  1041.  
  1042.  BC>>     For one thing, join us at TURBOVISION. It is an echo 
  1043.  BC>> made especially for discussing Turbo Vision.
  1044.  
  1045.  DM> I don't think TV is off-topic here, but if you want to advertise the
  1046.  DM> TV echo, shouldn't you say how to hook up?  Or is it on the backbone
  1047.  DM> now?
  1048.  
  1049. Dj,
  1050.     He didn't say it was offtopic but the guy clearly needs more help
  1051. than he will get here. He needs the basics... ALL OF THEM!! ;-) He
  1052. obviously hasn't read his book so he'll need all the help he can get and
  1053. the TurboVision echo is the best place for that.
  1054.  
  1055.         Best regards,
  1056.         Mark Ouellet.
  1057.  
  1058.  
  1059. --- Squish v1.01
  1060.  * Origin: Sequel to Cramer VS Cramer: TPCramer VS UUencode;-) (1:240/20.4)
  1061.  * Tossed by SFToss/286 v1.02a on 93/01/08  11:12:12
  1062.  
  1063. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1064.  
  1065. Conference 4
  1066. Date       01-08-93 20:05:00
  1067. From       Trevor Carlsen
  1068. To         All
  1069. Subject    My resignation as moderator.
  1070.  
  1071.  
  1072.  
  1073. Thanks to all those who have posted such ego-boosting echomail and netmail
  1074. messages to me. It is most gratifying.
  1075.  
  1076. As there are far too many messages to respond individually and as so many
  1077. have asked questions in netmail, here is the background to my decision...
  1078.  
  1079. 1. I have sold my programming and consultancy business.
  1080. 2. I have bought a supermarket in another town (1050kms away).
  1081. 3. I take it over on March 1.
  1082. 4. I will be "off-air" for up to a month at around that time.
  1083. 5. I will continue to promote the current contest.
  1084. 6. With DJM's permission, I have ideas for other contests.
  1085.  
  1086. P L E A S E  if you wish to comment on this, do it by  netmail only.
  1087.  
  1088. TeeCee
  1089.  
  1090. --- TC-ED   v2.01  
  1091.  * Origin: The Pilbara's Pascal Centre (+61 91 732930) (3:690/644)
  1092.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:17
  1093.  
  1094. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1095.  
  1096. Conference 4
  1097. Date       01-07-93 19:14:00
  1098. From       Dj Murdoch
  1099. To         All
  1100. Subject    Open Arch. description of help files
  1101.  
  1102.  This is for anyone who has bought the BP 7 edition of the Open Architecture
  1103. book.  
  1104.  
  1105. The BC++ edition describes the binary format of the .TCH/.TPH help files,
  1106. but leaves something out:  the Text Records appear to be terminated with a
  1107. ^A (#1) character, but this isn't mentioned.  The .C program to decompile
  1108. the help file ignores this character.  
  1109.  
  1110. Does the BP version of the book talk about this?  Can I count on it appearing
  1111. only at the end of a text record, or could one be embedded within the record?
  1112.  
  1113. Thanks in advance for any help.
  1114.  
  1115. --- Msg V3.2
  1116.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  1117.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:19
  1118.  
  1119. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1120.  
  1121. Conference 4
  1122. Date       01-07-93 19:25:00
  1123. From       Dj Murdoch
  1124. To         Mark Ouellet
  1125. Subject    Re: Turbo Vision
  1126.  
  1127.   MO>     He didn't say it was offtopic but the guy clearly needs more help
  1128.  MO> than he will get here. He needs the basics... ALL OF THEM!! ;-) He
  1129.  MO> obviously hasn't read his book so he'll need all the help he can get and
  1130.  
  1131.  MO> the TurboVision echo is the best place for that.
  1132.  
  1133. It's not on the backbone yet; how does someone get hold of it?
  1134.  
  1135. --- Msg V3.2
  1136.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  1137.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:19
  1138.  
  1139. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1140.  
  1141. Conference 4
  1142. Date       01-07-93 19:28:00
  1143. From       Dj Murdoch
  1144. To         Mark Ouellet
  1145. Subject    Re: Troi
  1146.  
  1147.   MO>     This is the Pascal echo, Trevor Carlsen was/is the moderator until
  1148.  MO> ?? can't remember what date.. At which time Duncan J Murdoch will be
  1149.  MO> taking over Trevor's responsability to the end of the normal term. At
  1150.  MO> which time I guess we'll have another election.
  1151.  
  1152. I won't be taking over until Feb 1, and only then if TC doesn't change his
  1153. mind.  There isn't any "normal term" or provision for an election for the
  1154. position unless the moderator calls one (or disappears and someone else calls
  1155. one).  
  1156.  
  1157. This is in the rules that TC posts monthly.  I'm not planning any changes.
  1158.  The moderator is a constitutional monarch, not a president :-).
  1159.  
  1160. --- Msg V3.2
  1161.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  1162.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:19
  1163.  
  1164. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1165.  
  1166. Conference 4
  1167. Date       01-07-93 19:45:00
  1168. From       Dj Murdoch
  1169. To         Chris Priede
  1170. Subject    Re: Simple TSR wanted
  1171.  
  1172.   CP>         It is rather hard to believe software could trash registers n
  1173.  CP> times per second and go unnoticed until a new version of TP arrives. 
  1174.  
  1175.  
  1176. This was one of the many things that delayed the release of PKZIP 2 for so
  1177. long.  There really is sloppy software out there that trashes the 386 registers.
  1178.  Not much any more; my call for testers only found one person who had actually
  1179. observed the problem.  This was on a Novell non-dedicated file server, whatever
  1180. that is.
  1181.  
  1182.  CP> It 
  1183.  CP> should have broken MANY other programs by now and fixed long ago. I'm
  1184.  CP> only guessing, but it is more likely TP runtime library expects values
  1185.  CP> to remain in extended registers for too long, in other words, after
  1186.  CP> calling some software interrupt. However, you are right, there is little
  1187.  CP> reason to call software interrupts during longint calculation.
  1188.  
  1189. In fact, the RTL source code comes with BP so this is easy to check - it doesn't
  1190. call any software interrupts during longint calculations.
  1191.  
  1192.  CP>         Anyway, if the problem is a hardware interrupt, then it is most
  1193.  CP> likely one of two timers: int 08h or 70h (AT real time clock). Could
  1194.  CP> also be something used by a network adapter, if there is one installed.
  1195.  CP> Nothing else occurs regularily enough, all other interrupts are executed
  1196.  CP> only if there is some activity on connected device (serial port, disk,
  1197.  CP> keyboard, etc.). 
  1198.  
  1199. I don't think this is safe reasoning.  If another hardware interrupt is bad,
  1200. it could still cause trouble even if it doesn't happen frequently.  It just
  1201. wouldn't cause so much trouble, so it would be harder to diagnose.
  1202.  
  1203. Try to save and restore all registers before calling
  1204.  CP> the original interrupt handler. Something like this should do:
  1205.  
  1206.  CP> .386
  1207.  
  1208.  CP> OldInt08        DD      ?
  1209.  
  1210.  CP> NewInt08        PROC    FAR
  1211.  CP>                 pushfd          ;save extended flags
  1212.  CP>                 pushad          ;save extended registers
  1213.  CP>                 pushf
  1214.  CP>                 call    cs:[OldInt08]   ;saved interrupt vect. in code seg
  1215.  
  1216.  
  1217. I thought of doing it this way, but decided on a more involved method.  There
  1218. are several problems with this fix:
  1219.   - it adds 42 bytes to the stack usage of the hardware interrupt;
  1220.   - it fails to protect FS and GS (which aren't used by TP, but might be used
  1221. by some assembly code); 
  1222.   - it would badly mess up a software interrupt that was expecting to return
  1223. information in the 8086 registers or flags.  I can't imagine why anyone would
  1224. put one of those on one of the hardware interrupts, but someone might. 
  1225.  
  1226. The solution I came up with is a little bit slower, a little bit less complete
  1227. (I forgot about the extended flags), quite a bit bigger, but it uses only
  1228. about 26 bytes of stack space and solves the other two problems above.
  1229.  
  1230. Here's my general purpose ISR:
  1231.  
  1232.  const
  1233.   { These constants allow us to code 386-specific instructions }
  1234.   Op32   = $66;
  1235.   PushFS = $A00F;
  1236.   PushGS = $A80F;
  1237.   PopFS  = $A10F;
  1238.   PopGS  = $A90F;
  1239.  
  1240.  procedure FixupISR; far; assembler;
  1241.  { This ISR saves and restores the high word of EAX,EBX,ECX,EDX,ESI, and EDI,
  1242.    plus FS and GS. Use it to fix up a bad handler.  Uses 26 bytes of stack 
  1243.  
  1244.    space. } 
  1245.  asm
  1246.   push bp
  1247.   mov bp,sp
  1248.  
  1249.   db Op32; push ax
  1250.   pop ax
  1251.   db Op32; push bx
  1252.   pop bx
  1253.   db Op32; push cx
  1254.   pop cx
  1255.   db Op32; push dx
  1256.   pop dx
  1257.   db Op32; push si
  1258.   pop si
  1259.   db Op32; push di
  1260.   pop di
  1261.   db Op32; push bp
  1262.   pop bp
  1263.   dw PushFS
  1264.   dw PushGS
  1265.   push word ptr [bp+6]           { old flags }
  1266.   mov bp,[bp]                    { and restore BP }
  1267.   call dword ptr cs:InterruptRecs[PtrOfs]
  1268.   push ax
  1269.   pushf
  1270.   pop ax                     { Now flags are in AX }
  1271.  
  1272.   push bp                    { Save the ISR's BP }
  1273.   mov bp,sp                  { Set up our frame again }
  1274.   add bp,22
  1275.   mov word ptr [bp+6],ax      { This way flags on our return will be
  1276.                                    as the old ISR returned them. }
  1277.   pop ax
  1278.   mov word ptr [bp],ax        { as will BP }
  1279.  
  1280.   pop ax
  1281.   dw PopGS
  1282.   dw PopFS
  1283.   push bp
  1284.   db Op32; pop bp
  1285.   push di
  1286.   db Op32; pop di
  1287.   push si
  1288.   db Op32; pop si
  1289.   push dx
  1290.   db Op32; pop dx
  1291.   push cx
  1292.   db Op32; pop cx
  1293.   push bx
  1294.   db Op32; pop bx
  1295.   push ax
  1296.   db Op32; pop ax
  1297.  
  1298.   pop bp
  1299.   iret
  1300.  end;
  1301.  
  1302.  CP>         Install an interrupt handler like this on both timer interrupts
  1303.  CP> and any other interrupts you suspect. The old interrupt vector variable
  1304.  CP> should be in code segment, so we can access it without loading a segment
  1305.  CP> register. If it helps, then you will know which interrupt is guilty and
  1306.  CP> all you have to do is trace through the interrupt handler.
  1307.  
  1308. A longer version of my code checked the returned values of all the registers
  1309. against the saved values, and recorded instances where they were changed.
  1310.  If you want to see that, look for TRASH.ZIP.  I sent it out on PDN a few
  1311. days ago, and it's also available on Internet from garbo.uwasa.fi:/pc/turbopas.
  1312.  
  1313.  
  1314. --- Msg V3.2
  1315.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  1316.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:19
  1317.  
  1318. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1319.  
  1320. Conference 4
  1321. Date       01-07-93 07:48:00
  1322. From       Dj Murdoch
  1323. To         Jason Huebel
  1324. Subject    Re: Typed Files.
  1325.  
  1326.   DM> FillChar(myrec,sizeof(myrec),0);
  1327.  
  1328.  JH> I've found that isn't really necessary. I could be wrong, 
  1329.  JH> but you don't need
  1330.  JH> to initialize the variables since it saves the length byte in the file. Is
  1331.  
  1332.  JH> that true? I mean, from what I've worked on so far in TP 
  1333.  JH> and typed files, it's
  1334.  JH> worked for me so far.
  1335.  
  1336. It depends what you mean by "necessary".  If your aim is to make the string
  1337. readable, then you don't need to bother.  If you're worried that the junk
  1338. at the end of the string might contain sensitive information (a decrypted
  1339. password, for instance) because it happened to be sitting in memory at just
  1340. the right place, then you'll want to clear out the junk.
  1341.  
  1342. --- Msg V3.2
  1343.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  1344.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:37
  1345.  
  1346. ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1347.  
  1348. Conference 4
  1349. Date       01-07-93 07:56:00
  1350. From       Dj Murdoch
  1351. To         Mark Mckay
  1352. Subject    Re: tp7/bp7 bugs
  1353.  
  1354.   MM> Problem:  Keyboard useless in TPX.EXE IDE when mixing 
  1355.  MM> mouse and keyboard           commands.
  1356.  
  1357. Thanks for sending the report.  I'd suspect your mouse driver; is there any
  1358. chance you could try a different version?
  1359.  
  1360.  
  1361. --- Msg V3.2
  1362.  * Origin: Murdoch's_Point  - -   (1:249/99.5)
  1363.  * Tossed by SFToss/286 v1.02a on 93/01/09  00:39:38
  1364.